package com.cqc.googleplay.adapter;

import java.util.List;

import com.cqc.googleplay.application.ImageLoaderOptions;
import com.cqc.googleplay.http.NetUrl;
import com.nostra13.universalimageloader.core.ImageLoader;

import android.content.Context;
import android.support.v4.view.ViewPager.LayoutParams;
import android.view.ViewGroup;
import android.widget.ImageView;

public class BannerPagerAdapter extends BasePagerAdapter<String> {

	public BannerPagerAdapter(List<String> list) {
		super(list);
	}

	@Override
	public Object instantiateItem(ViewGroup container, int position) {
		ImageView iv = new ImageView(container.getContext());
		
		ImageLoader.getInstance().displayImage(NetUrl.IMAGE_PREFIX + list.get(position), iv, ImageLoaderOptions.pagerOptions);
		LayoutParams params = new LayoutParams();
		params.width = LayoutParams.MATCH_PARENT;
		params.height = LayoutParams.MATCH_PARENT;
		container.addView(iv,params);
		return iv;
	}

}
